Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #61305

Merged
merged 38 commits into from
May 29, 2019
Merged

Rollup of 11 pull requests #61305

merged 38 commits into from
May 29, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented May 29, 2019

Successful merges:

Failed merges:

r? @ghost

jtdowney and others added 30 commits March 6, 2019 12:17
This is similar to the existing implementation for `Result`. It will
take each item into the accumulator unless a `None` is returned.
Co-Authored-By: jtdowney <jdowney@gmail.com>
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
Methods on the Weak to access it as raw pointer to the data.
Methods on the Weak to access it as a raw pointer to the data.
Extracted from work on rust-lang#59346. This moves the annotation collection to
the `FileWithAnnotatedLines` impl to allow re-use in a separate
EmitterWriter.
…r=dtolnay

Implement `iter::Sum` and `iter::Product` for `Option`

This is similar to the existing implementation for `Result`. It will take each item into the accumulator unless a `None` is returned.

I based a lot of this on rust-lang#38580. From that discussion it didn't seem like this addition would be too controversial or difficult. One thing I still don't understand is picking the values for the `stable` attribute. This is my first non-documentation PR for rust so I am open to any feedback on improvements.
…tmcm

Add Step::sub_usize

Required for rust-lang#54054.

I'm aware that the `Step` trait needs a rework, but this still seems like a reasonable addition?

This currently doesn't compile because Chalk contains a type that implement this trait, and this is a breaking change. How can that be fixed?
…ottmcm

Implement nth_back for RChunks(Exact)(Mut)

Part of rust-lang#54054.

These implementations may not be optimal because of the use of `self.len()`, but it's quite cheap and simplifies the code a lot.

There's quite some duplication going on here, I wouldn't mind cleaning this up later. A good next step would probably be to add private `split_off_up_to`/`split_off_from` helper methods for slices since their behavior is commonly useful throughout the `Chunks` types.

r? @scottmcm
Weak::into_raw

Hello

This is my first shot at rust-lang#60728. I'd like to consult it a bit before moving further.

The biggest question I have is if this API makes sense. My motivation for it is to be able to store the `Weak` in `AtomicPtr`. For that I don't actually need for the pointer to point to the `T`, any pointer (maybe casted to `usize`) would be good enough, but this mirrors what `Arc` does and could be useful for other things too (like comparing if Arc and Weak point to the same thing without playing with the counts), while some opaque pointer wouldn't.

Some secondary questions, if this is deemed desirable are:
* The weak pointer may be dangling if it is created by `Weak::new()`. It would make sense to treat this as NULL, but that is incompatible with `T: ?Sized` ‒ both `new()` and `ptr::null()` are available only for sized types. The current implementation is therefore also available only for sized `T`s. It would be possible to allow `?Sized` if the API would be `fn into_raw(self) -> Option<NonNull<T>>` and `fn from_raw(NonNull<T>)`, but that's different API than `Arc` has. What would be preferred?
* There's a FIXME in my code about what I suspect could be UB. Is it really UB & how to get the pointer correctly? Is manual offsetting of the pointer the only way?
* Am I missing some other necessary thing around the feature gates and such?
* Is the documentation understandable? I know writing docs is not my strongest skill :-|.

Thinks I'd like to do as part of the PR, but are not yet done:
* Turn the referenced issue into tracking issue for the feature flag.
* Once the `sync::Weak` is considered reasonable, I'd do the equivalent for `rc::Weak`.
* This might call for few more tests than what is currently part of the documentation.
…scottmcm

Feature/nth back chunks

A succinct implementation for nth_back on chunks. Thank you @timvermeulen for the guidance.

r? @timvermeulen
…gs1, r=estebank

librustc_errors: Move annotation collection to own impl

Extracted from work on rust-lang#59346. This moves the annotation collection to
the `FileWithAnnotatedLines` impl to allow easier re-use in a separate
EmitterWriter. Even without that new EmitterWriter present, I think it makes
sense to have this as an associated function.
…oli-obk,Centril

Rename Place::local to Place::local_or_deref_local

r? @oli-obk
Rename `TraitOrImpl` to `Assoc` and `trait_or_impl` to `assoc`.
Remove LLVM instruction stats and other (obsolete) codegen stats.

Both `-Z count_llvm_insns` and `-Z codegen-stats` are removed, as (AFAIK) they have been of little use in the last few years, especially after the transition to MIR->LLVM codegen.

Other than for the LLVM instruction counts, `-Z codegen-stats` has long been obsoleted anyway.

r? @nagisa cc @rust-lang/compiler
@Centril
Copy link
Contributor Author

Centril commented May 29, 2019

@bors r+ rollup=never p=11

@bors
Copy link
Contributor

bors commented May 29, 2019

📌 Commit 907f4fd has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 29, 2019
@bors
Copy link
Contributor

bors commented May 29, 2019

⌛ Testing commit 907f4fd with merge 8197085...

bors added a commit that referenced this pull request May 29, 2019
Rollup of 11 pull requests

Successful merges:

 - #58975 (Implement `iter::Sum` and `iter::Product` for `Option`)
 - #60542 (Add Step::sub_usize)
 - #60555 (Implement nth_back for RChunks(Exact)(Mut))
 - #60766 (Weak::into_raw)
 - #61048 (Feature/nth back chunks)
 - #61191 (librustc_errors: Move annotation collection to own impl)
 - #61235 (Stabilize bufreader_buffer feature)
 - #61249 (Rename Place::local to Place::local_or_deref_local)
 - #61291 (Avoid unneeded bug!() call)
 - #61294 (Rename `TraitOrImpl` to `Assoc` and `trait_or_impl` to `assoc`.)
 - #61297 (Remove LLVM instruction stats and other (obsolete) codegen stats.)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented May 29, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 8197085 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet